<!DOCTYPE html>
<html xmlns:layout="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
	layout:decorate="~{common/layout}">

<head>
	<meta charset="UTF-8">
	<title>账号管理</title>
	<style>
	 
	</style>
</head>

<body>
	<div layout:fragment="fragment_body">
		<el-empty description="暂无结果" v-if="list == null || list.length == 0"></el-empty>
		<el-table :data="list" v-if="list !== null && list.length > 0" border style="width: 100%;margin-top: 12px;">
			<el-table-column prop="accountName" label="登录账号" ></el-table-column>
			<el-table-column prop="accountRole" label="角色"></el-table-column>
			<el-table-column prop="accountCreate" label="注册时间" ></el-table-column>
			<el-table-column prop="accountId" label="操作" width="150">
				<template #default="scope">
					<el-button type="text" size="small" @click="rePsw(scope.row.accountId)">重置密码</el-button>
				</template>
			</el-table-column>
		</el-table>
	</div>
</body>
<script type="text/javascript" layout:fragment="fragment_script">
	const _data = {
		list: [],
	}
	const _method = {
		loadAccounts() {
			let that = this
			that.listLoading = true
			getRequst('/account/list').then(function (resp) {
				that.list = resp.data
				that.listLoading = false
			})
		},
		rePsw(id){
			let that = this
			getRequst('/account/rePsw?userId=' + id).then(function (resp) {
				if(resp.status == 0){
					that.$message.success(resp.msg);
					return false
				}
				that.$message.error(resp.msg);
			})
		}
	}
	function _created() {
		this.loadAccounts()
	}
	const _watch = {
		
	}
</script>

</html>